Dragonball Z: Assault of the Saiyans
English Patch - Source Code
Intial Release: Oct. 13, 2006
by Twilight Translations
copyright 2006
--------------------------------------

1. Introduction
2. Contents

--------------------------------------

1. Introduction

--------------------------------------

I remember when I first started learning assembly language (refered to from here on
as simply "asm"). I had no idea where to begin and even more so how to apply
anything I learned to modifying a video game (asm hacking as it's known in romh
circles).

I eventually did, however, figure it out after countless sleepless nights and months.
The thing, I felt, that contributed a lot to my difficulties was the lack of any
available source code that worked and was for the NES. I vowed that if I ever managed
to learn, that I would share my knowledge in some way. Since I'm not such a great
teacher, this package of source code, that I used in my translation of Dragonball Z:
Assault of the Saiyans, will have to suffice.

Since this was the first asm mod I ever did, the source code is almost completey
commented. Hopefully this will provide a much, much better learning tool than the
other source packages I've released.

I'd suggest if you're learning to grab a copy of the rom and the patch and compare
the unaltered Japanese ROM to the English ROM.

--------------------------------------

2. Contents

--------------------------------------

All of the source code included was compiled with x816.

Please note that these are merely the most up-to-date files for what ended up in the
patch. As I was still learning at the time, I kept notes of what I changed manually
on paper (I actually have a thick folder full of indecipherable notes for this game,
including many of the systems that I didn't alter), some of the changes made to the
game are not documented. For instance, I can't find the code for initializing the
memory used by the huffman decompression routine. There are probably other things too.

dbz1eos.asm -  I don't entirely remember the reason for this, other than the End of
	       String checking was finicky (or at least to a wet-behind the ears newby
	       it was.

dbz1hset.asm - This clears out the bit counter and one of the other variables. I'm not
	       sure what $5D is.

dbz1huff.asm - The huffman decoding routine. This was based largely on a similar
	       routine that SnowBro released in a package of source code on NESDEV.
	       The look up table consists of 2 bytes for each node;
	       If the the first byte is $00, then the node is a leaf node and the
	       second byte is the character's decoded value.

	       Also in this file is the huffman-compatible text read routine, which
	       JMPs to dbz1eos.asm and dbz1var.asm and should be the only routine that
	       has direct access to those routines.

dbz1var.asm -  The variable control code routines had to be rewritten to handle all
	       of the decompression that was going on and this does that.

dbz3vram.asm - A simple modification to the PPU writing routine to allow text to be
	       displayed on the line originally used for the Japanese accent marks.